package com.caption.mq.core;
import com.caption.mq.entity.MqSubscribeDO;
import com.caption.mq.listener.AbstractMqListener;

public abstract class AbstractMqConsumer {

    protected MqSubscribeDO subscribe;

    public AbstractMqConsumer (MqSubscribeDO subscribe){
        this.subscribe=subscribe;
    }

    /**
     * 订阅主题
     * @param topic
     * @param tag
     */
   abstract public void subscribe(String topic,String tag);

    /**
     * 注册监听器
     */
   abstract public void registerMessageListener(AbstractMqListener listener);

    /**
     * 开启监听
     */
   abstract public void start();

    /**
     * 停止监听
     */
   abstract public void shutdown();

}
